package dao;

import moudle.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentDao {
//    渲染数据
    @Select("select * from Student")
    List<Student> getAllDao();
//    删除
    @Delete("delete from student where id=#{id}")
    int delDao(Integer id);
//    添加
    @Insert("insert into student values (null,#{name},#{sex},#{age})")
    int insertDao(Student student);
//    拿到一条数据
    @Select("select * from student where id=#{id}")
    Student getOneDao(Integer id);
//    更新
    @Update("update student set name=#{name},sex=#{sex},age=#{age} where id=#{id}")
    int updateDao(Student student);
//    分页查询
    @Select("select * from student limit #{start},#{pageSize}")
    List<Student> fenYeDao(@Param("start") Integer start,@Param("pageSize") Integer pageSize);
}
